package com.pq.controller;

import com.pq.entity.StorageDO;
import com.pq.enums.CommonCode;
import com.pq.exception.BizServiceException;
import com.pq.service.StorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/storage")
@Slf4j
public class StorageController {

    @Resource
    private StorageService storageService;
    /**
     * 商品库存扣减
     * @return
     */
    @GetMapping("/subtract")
    public boolean subtract(@RequestParam("id") Long id){
        return storageService.subtract(id);
    }
    @GetMapping("/subtractError")
    public boolean subtractError(@RequestParam("id") Long id){
        return storageService.subtractError(id);
    }
}
